<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%/***********************************************
* 파일명 : BDADM_CodeAuth.jsp
* 기  능 : 관리자>권한관리 조회
* 최초 작성일 : 2008/11/11
* @author : seo myeong seong
*************************************************/%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN" "http://www.w3.org/TR/htmL1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<s:head theme="ajax" />
<link rel="stylesheet" type="text/css" href="./inc/css/common.css">
<!-- <script language="javascript" src="./script/BDADM_Auth.js"></script> -->
<script src="inc/js/aa.js"></script>
<script type="text/javascript">

	//직책 선택
	function fnc_onchange() {

		form.auth.value	=	form.select.value 	
		$("#select").css({backgroundColor:'#3366FF',color:'#FFFFFF'});
		if($("#select").val() == "all"){
            $("#select").css({backgroundColor:'#ffffff',color:'#656464'});
    		}
		dojo.event.topic.publish("show_list");

		return false;
	}

	//허용 , 불가
	function fnc_access_yn(yn) {

		var choice = frm2.check; 

		var chk 			= 	false;
		var change_data 	= 	"";
		var subList			=	new Array();

		if (typeof frm2.check.length == "undefined") {
			alert("선택할 데이터가 없습니다.");
			return false;
		}

		if (frm2.check.length == undefined) {
			alert('undef..................');
		} else {

			var count = 0;
			//선택 되었는지 확인
			for (var i=0 ; i < frm2.check.length ; i++) {   
				   if( frm2.check[i].checked) {   
					   chk = true;
					   break;
				   }
			}

			if (!chk) {
				alert("선택을 하시기 바랍니다.");
				return false;
			}

			for ( var i = 0; i < frm2.check.length; i++) {
				if (frm2.check[i].checked) {
					//2개씩 담는다. 나중에 2개가 1set이 돼게 자른다.
					subList.push(frm2.check[i].value);
					subList.push(yn);
				}
			}
			
			change_data = subList;

			document.getElementById("change_data").value = change_data;	//체크한 데이터들을 전달
			
			dojo.event.topic.publish("show_list1");

		}

		return false;
	}

	//전체선택
	function selectCheck(){
		
		var check 		= frm2.check;
		
		var selectAll 	= frm2.selectAll.checked;
		
		if( selectAll ) {
			frm2.check.checked = true;
			
			for(i=0 ; i < check.length ; i++){
			   check[i].checked=true;
			}
		} else {
			frm2.check.checked = false;
			
			for(i=0 ; i < check.length ; i++){
			   check[i].checked=false;
			}
		}		
	}
	
	/*
	* 메뉴 관리 팝업 호출
	*/
	function fnc_BDADM_Manager(menu_code){
		var menu_code = menu_code; 			// 화면 code
		var auth = form.select.value; 		// 권한
		
		var w 		= 350;
		var h 		= 230;
		
		var x 		= 	fnc_center_x(w);
		var y 		= 	fnc_center_y(h);

		var url 	= 	"BDADM_Manager_p.action";
		var nm 		= 	"detail";
		var attr 	= 	"width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no , scrollbars=no";   //window size
		
		var param	=	"params=" + menu_code+"/"+auth;
		
			url		+=	"?" + param;

		window.open(url , nm , attr);
		
		return false;
	}
</script>
</head>
<body oncontextmenu="return false">
	<!--------- Contants Range : STR--------------->
	<div class="fl_ri">
		<div id="contants_box">
			<div id="tit">  
				<span class="fl_ri tit_navi">Home > 관리자 > <span class="f_b">권한관리</span><img src="./images/btl_navi.gif" class="img_tp"></span>
				<div class="fl_le"><img src="./images/tit_menu05_img07.gif"></div>
			</div>
		<s:form name="form" id="form" theme="simple" method="post">  
			<s:hidden id="cur_page" name="cur_page"/>
			<s:hidden name="auth" id="auth" />
			<!----------Search_Box : STR ---------->
			<div id="search03">
				<div id="search_box03">
					<ul>
					<span class="up">
						<li class="txt">관리자</li>
						<li class="input">
							<s:select name="select" id="select" value="user.empInfo.position_no" list="listAdmin" listKey="code_fcd" listValue="code_nm" headerKey="all" headerValue="::선택하세요::" onchange="return fnc_onchange()" cssClass="combobox100se"/>								
						</li>
					</span>	
					</ul>
				</div>
			</div>	
			<!----------Search_Box : ENd ---------->
			<!----------Tbl_info & Table box ------>
			<!----------Tbl_info & Table box ------>
		</s:form>
		<s:form name="frm2" id="frm2" theme="simple" method="post">
			<s:url id="show_list" action="BDADM_Auth_Search" /><!-- BDADM_Auth_Frame.jsp -->
			<s:div showLoadingText="false" href="%{show_list}"  theme="ajax" formId="form" listenTopics="show_list" executeScripts="true"/>
		</s:form>
		
			<s:url id="show_list1" action="BDADM_Auth_Update" /><!-- BDADM_Auth_Frame_Ajax_List.jsp -->
			<s:div showLoadingText="false" href="%{show_list1}"  theme="ajax" formId="frm2" listenTopics="show_list1" executeScripts="true"/>
		</div>
	</div>
	<!--------- Contants Range : END--------------->

</body>
</html>